<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>index</title>
  <link rel="stylesheet" href="stylesheets/bootstrap.min.css">
  <link rel="stylesheet" href="stylesheets/flat-ui.min.css">
  <link rel="stylesheet" href="stylesheets/index.css">
</head>
<body>
  <div class="login-wrapper">
    <div class="login-form">
      <div class="form-group">
        <input type="text" class="form-control login-field" value="" placeholder="请输入账号" id="login-name" />
        <label class="login-field-icon fui-user" for="login-name"></label>
      </div>

      <div class="form-group">
        <input type="password" class="form-control login-field" value="" placeholder="请输入密码" id="login-pass" />
        <label class="login-field-icon fui-lock" for="login-pass"></label>
      </div>
      <a class="btn btn-primary btn-lg btn-block registerBtn" href="#">注 册</a>
      <a class="btn btn-primary btn-lg btn-block loginBtn" href="#">登 录</a>
      <a class="login-link" href="#">忘记密码？</a>
    </div>
  </div>
  <script src = "js/jquery.min.js"></script>
  <script src = "js/flat-ui.min.js"></script>
  <script>
  $(".registerBtn").on("click",function () {
    $.ajax({
      url: 'api/register',
      type: 'POST',
      data: {
        userName: $("#login-name").val(),
        pwd: $("#login-pass").val(),
      },
      success: function (req) {
        console.log(req);
      }
    });
  })

  $(".loginBtn").on("click",function () {
    $.ajax({
      url: 'api/login',
      type: 'POST',
      data: {
        userName: $("#login-name").val(),
        pwd: $("#login-pass").val(),
      },
      success: function (req) {
        console.log(req);
      }
    });
  })
  </script>
</body>
</html>